<!--
  @author duanzuocai
  @since 2018/10/23 15:12
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid">

    <div class="layui-card">

        <div class="layui-card-body">

            <!--表单样式统一为layui-form(必需样式)，lay-filter属性统一定义为zmn-form-->
            <form method="POST" action="" class="layui-form" lay-filter="zmn-form">

                <input type="hidden" name="attrId" th:value="${attr.attrId}"/>
                <input type="hidden" name="attrType" th:value="${attr.attrType}"/>
                <input type="hidden" name="categId" th:value="${categ.categId}"/>
                <div class="layui-form-item">
                    <label class="layui-form-label">属性名称：</label>
                    <div class="layui-input-inline" style="width:300px;">
                        <input type="text" lay-verify="required" name="name" th:value="${attr.name == null ? '': attr.name}" autocomplete="off" class="layui-input"/>
                        <!--表单说明置于表单元素后方-->
                    </div>
                </div>
                <div class="layui-form-item" th:if="${attr.attrType == 2}">
                    <label class="layui-form-label">使用渠道：</label>
                    <div class="layui-input-inline" style="width:300px;">
                        <select lay-filter="channelId" id="channelId" name="channelId" lay-search lay-verify="required">
                            <option value="">-选择二级渠道-</option>
                            <option th:each="channel:${channelList}" th:value="${channel.channelId}" th:selected="${attr.channelId == channel.channelId}"
                                    th:text="${channel.name}" />
                        </select>
                    </div>
                </div>
                <!--按钮栏
                    置于form标签内的最下方，
                    主功能按钮使用默认样式，次要功能按钮使用原始按钮(加入样式layui-btn-primary)
                    -->
                <div class="layui-form-item submit">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">提交</button>
                        <button onclick="parent.layui.element.tabDelete('layadmin-layout-tabs', window.location.pathname + window.location.search)" class="layui-btn layui-btn-primary" id="cancel">取消</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        art_categ_attr_detail: "categroy/zmn.art.categ.attr.edit",
    }).use(['index', 'art_categ_attr_detail']);

</script>